import request from './request'
import type { LoginRequest, LoginResponse } from '@/types'

export const authAPI = {
  login: (username: string, password: string): Promise<LoginResponse> => {
    return request.post('/auth/login', { username, password })
  },
  
  register: (data: {
    username: string
    password: string
    email: string
    phone?: string
  }) => {
    return request.post('/auth/register', data)
  },
  
  getProfile: () => {
    return request.get('/profile')
  }
}